/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package diet.XMLUtils;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Vrety
 */
public class XMLAutoGenerate implements Runnable {

    String path;
    JAXB jaxb = new JAXB();

    public XMLAutoGenerate() {
    }

    public XMLAutoGenerate(String path) {
        this.path = path;
    }

    public void run() {
       // XMLUltis.test(path);
        while (true) {
            try {
                jaxb.generateDishXML(path);
                jaxb.generateFoodXML(path);
                jaxb.generateDietXML(path);
                jaxb.generateDishDetailXML(path);
                //generate DietInfo
                Thread.sleep(1000 * 60 *60);
            } catch (InterruptedException ex) {
                Logger.getLogger(XMLAutoGenerate.class.getName()).log(Level.SEVERE, null, ex);
            }

        }
    }
}
